import React,{useState} from 'react'

function Counter(){
	const [count,setCont]=useState(0);
	const increment=()=>{
		setCont(count+1);
	}
	const decrement=()=>{
		setCont(count-1);
	}
	return (
		<div className="container">
			<div className="wrapper">
				<h4 className="display-4">{count}</h4>
				<button onClick={increment} className="btn btn-primary">自增</button>
				<button onClick={decrement} className="ml-2 btn btn-danger">自减</button>
			</div>
		</div>
	)
}

export default Counter